menushell: Make select_first() do that, not last…
authorDaniel Boles <dboles@src.gnome.org>
Sat, 21 Jan 2017 15:50:54 +0000 (15:50 +0000)
committerDaniel Boles <dboles@src.gnome.org>
Sat, 21 Jan 2017 15:50:54 +0000 (15:50 +0000)
commita5211adb225172195d6778d652b58632c38afcbf
treee0524b8fd3204a6e96d7ff76e3c986964371845a
parent06269bf3679360705607298e73ff7a6975f3aec3
menushell: Make select_first() do that, not last…

It was looping over all items, not breaking out when it found the first
selectable one, and then selecting the _last_ selectable one (if any)
found. So, it did exactly the opposite of its name. This made me quite
baffled when opening a submenu with right-arrow put me at its last item.

Originally, the loop set to_select and broke if the current item was
selectable and not tear-off, meaning that it would correctly select the
first suitable item. However, when tear-off functionality was removed
in commit 4ed9452e9028bb90589474783cebac57ab66e2c9, so was the break.
gtk/gtkmenushell.c